-------------------------
2_Code to generate TdP score from predictions

Candidate Number: 1048238
-------------------------

Contents:
------

- The file TdP_main.py is the code used to calculate the TdP score of drugs based on their number of repolarisation abnormalities predicted by the proposed machine learning algorithm - 2 random forest classifiers.
- The pre-trained random forest classifiers - one for each cardiac model considered is saved and loaded to predict on the given data.
- The pre-trained models are available in the Folder titled ‘models’

- The path_to_data variable points to the folder (here, ./Data/model_name) containing 4 folders for each concentration - 100x, 30x, 10x, 1x - each folder has individual CSV files for the drugs. This is where the predictions for each drug at 4 concentrations each comes from.
- We have included a sample of the directory structure here (in the form of empty folders), but due to size constraints on the thesis submission - the whole dataset is available on request
    - Note: For this code, the ToR model classification uses Action Potential and Calcium Transient biomarkers.

- There is an option to run this for each of the cardiac models, preferences are obtained dynamically at run-time.

- Output is saved in 2 files to the Output folder - one file for the predicted TdP scores, one for the real TdP score (for comparison)
- In the output files, the drugs with score > 0 are risky and those with score = 0 are safe


------
Usage
------
> python TdP_main.py

------
Dependencies
------
This code has been tested in an environment, with:

* Python 3.8
* joblib 1.0.1
* pandas 1.1.5
* glob
* tqdm
* numpy

------------------------------------------------------------------------------------------
